package cn.com.open.itembank.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 试题结构.
 */
public class QuestionStructure {
    public QuestionStructure() {
        this.questionID = "";
        this.serialNumber = 0;
        this.mutexGroupIDs = new ArrayList<>();
        this.displayCount = 0;
        this.chapterID = "";
        this.difficulty = 0;
        this.mediaDuration = 0;
        this.questionCategories = "";
        this.isSubjective = 0;
    }

    /**
     * 试题.
     */
    private String questionID;

    /**
     * 试题索引ID.
     */
    private Integer serialNumber;

    /**
     * 互斥试题列表.
     */
    private List<String> mutexGroupIDs;

    /**
     * 曝光次数.
     */
    private Integer displayCount;

    /**
     * 所属章节.
     */
    private String chapterID;

    /**
     * 难度.
     */
    private double difficulty;

    /**
     * 媒体时长.
     */
    private Integer mediaDuration;

    /**
     * 试题应用类别（以/分隔的字符串）
     */
    private String questionCategories;

    /**
     * 是否是主观题：0，不是；1，是
     */
    private Integer isSubjective;

    /**
     * Gets is subjective.
     *
     * @return the is subjective
     */
    public Integer getIsSubjective() {
        return isSubjective;
    }

    /**
     * Sets is subjective.
     *
     * @param isSubjective the is subjective
     */
    public void setIsSubjective(Integer isSubjective) {
        this.isSubjective = isSubjective;
    }

    /**
     * Gets question id.
     *
     * @return the question id
     */
    public String getQuestionID() {
        return questionID;
    }

    /**
     * Sets question id.
     *
     * @param questionID the question id
     */
    public void setQuestionID(String questionID) {
        this.questionID = questionID;
    }

    /**
     * Gets serial number.
     *
     * @return the serial number
     */
    public Integer getSerialNumber() {
        return serialNumber;
    }

    /**
     * Sets serial number.
     *
     * @param serialNumber the serial number
     */
    public void setSerialNumber(Integer serialNumber) {
        this.serialNumber = serialNumber;
    }

    /**
     * Gets repulsive group i ds.
     *
     * @return the repulsive group i ds
     */
    public List<String> getMutexGroupIDs() {
        if (mutexGroupIDs == null) {
            mutexGroupIDs = new ArrayList<>();
        }
        return mutexGroupIDs;
    }

    /**
     * Gets display count.
     *
     * @return the display count
     */
    public Integer getDisplayCount() {
        return displayCount;
    }

    /**
     * Sets display count.
     *
     * @param displayCount the display count
     */
    public void setDisplayCount(Integer displayCount) {
        this.displayCount = displayCount;
    }

    /**
     * Gets chapter id.
     *
     * @return the chapter id
     */
    public String getChapterID() {
        return chapterID;
    }

    /**
     * Sets chapter id.
     *
     * @param chapterID the chapter id
     */
    public void setChapterID(String chapterID) {
        this.chapterID = chapterID;
    }

    /**
     * Gets difficulty.
     *
     * @return the difficulty
     */
    public double getDifficulty() {
        return difficulty;
    }

    /**
     * Sets difficulty.
     *
     * @param difficulty the difficulty
     */
    public void setDifficulty(double difficulty) {
        this.difficulty = difficulty;
    }

    /**
     * Gets media duration.
     *
     * @return the media duration
     */
    public Integer getMediaDuration() {
        return mediaDuration;
    }

    /**
     * Sets media duration.
     *
     * @param mediaDuration the media duration
     */
    public void setMediaDuration(Integer mediaDuration) {
        this.mediaDuration = mediaDuration;
    }

    /**
     * Gets question categories.
     *
     * @return the question categories
     */
    public String getQuestionCategories() {
        return questionCategories;
    }

    /**
     * Sets question categories.
     *
     * @param questionCategories the question categories
     */
    public void setQuestionCategories(String questionCategories) {
        this.questionCategories = questionCategories;
    }

    /**
     * Get by question.
     *
     * @param question      the question
     * @param mutexGroupIDs the mutex group i ds
     */
    public void getByQuestion(RuleQuestionModel question, List<String> mutexGroupIDs) {
        this.questionID = question.getQuestionId();
        this.mutexGroupIDs = mutexGroupIDs;
        this.serialNumber = question.getSerialNumber();
        this.displayCount = question.getDisplayCount();
        this.difficulty = question.getDifficulty();
        this.chapterID = question.getChapterId();
        this.isSubjective = question.getIsSubjective();
    }

    /**
     * copy question structure.
     *
     * @return the question structure
     */
    public QuestionStructure copy() {
        QuestionStructure copy = new QuestionStructure();
        copy.questionID = questionID;
        copy.mutexGroupIDs = mutexGroupIDs;
        copy.serialNumber = serialNumber;
        copy.displayCount = displayCount;
        copy.difficulty = difficulty;
        copy.chapterID = chapterID;
        copy.mediaDuration = mediaDuration;
        copy.questionCategories = questionCategories;
        copy.isSubjective = isSubjective;
        return copy;
    }
}
